package com.zhny.sensor.dao;

import com.zhny.sensor.entity.Entrust;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.List;

public interface EntrustRepositiry extends JpaRepository<Entrust, String> {

    @Transactional
    @Modifying
    @Query(value = "update entrust set state = ?1  where barcodeNumber = ?2 and state = ?3",nativeQuery = true)
    int updateEntrustState(Integer state1, String barcodeNumber, Integer state2);
}
